x86/vmx: always sync PIR to IRR before vmentry
authorRoger Pau Monné <roger.pau@citrix.com>
Wed, 11 Dec 2019 14:27:17 +0000 (15:27 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 11 Dec 2019 14:27:17 +0000 (15:27 +0100)
commitd397a5a31aec25b1e9242486930ddf7bed149865
tree66c5ecaf127c7708b301837e278b32d7af44b4f3
parent6a4006708f47ec6f5c4ae78fb344c2e5be66e78a
x86/vmx: always sync PIR to IRR before vmentry

When using posted interrupts on Intel hardware it's possible that the
vCPU resumes execution with a stale local APIC IRR register because
depending on the interrupts to be injected vlapic_has_pending_irq
might not be called, and thus PIR won't be synced into IRR.

Fix this by making sure PIR is always synced to IRR in
hvm_vcpu_has_pending_irq regardless of what interrupts are pending.

Reported-by: Joe Jin <joe.jin@oracle.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Tested-by: Joe Jin <joe.jin@oracle.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
master commit: 56348df32bbc782e63b6e3fb978b80e015ae76e7
master date: 2019-11-28 11:58:25 +0100
xen/arch/x86/hvm/irq.c
xen/arch/x86/hvm/vlapic.c
xen/include/asm-x86/hvm/vlapic.h